﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YdWorkFlow.Core.Model
{
    public class ActorDefinition : BaseDefinition
    {
        public static ActorDefinition CreateIsIdentity(string name, string identityId)
        {
            return new ActorDefinitionIsIdentity() { Name = name, IdentityId = identityId };
        }

        public static ActorDefinition CreateIsInRole(string name, string roleId)
        {
            return new ActorDefinitionIsInRole() { Name = name, RoleId = roleId };
        }

        public static ActorDefinition CreateIsInJob(string name, string jobId)
        {
            return new ActorDefinitionIsInJob() { Name = name, JobId = jobId };
        }

        public virtual void AddParameter(string key, string value) { }
    }

    /// <summary>
    /// 用户
    /// </summary>
    public class ActorDefinitionIsIdentity : ActorDefinition
    {
        public string IdentityId { get; internal set; }
    }

    /// <summary>
    /// 角色
    /// </summary>
    public class ActorDefinitionIsInRole : ActorDefinition
    {
        public string RoleId { get; internal set; }

    }

    /// <summary>
    /// 职务
    /// </summary>
    public class ActorDefinitionIsInJob : ActorDefinition
    {
        public string JobId { get; internal set; }

    }
}
